package com.order.manager.Model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 
 * @TableName collect_info
 */
@TableName(value ="collect_info")
@Data
public class CollectInfo implements Serializable {
    /**
     * 收藏id
     */
    @TableId(type = IdType.AUTO)
    private Long collectId;

    /**
     * 收藏用户id
     */
    private String collectUserId;

    /**
     * 收藏商店id
     */
    private String collectShopId;

    /**
     * 输入时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date inputTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        CollectInfo other = (CollectInfo) that;
        return (this.getCollectId() == null ? other.getCollectId() == null : this.getCollectId().equals(other.getCollectId()))
            && (this.getCollectUserId() == null ? other.getCollectUserId() == null : this.getCollectUserId().equals(other.getCollectUserId()))
            && (this.getCollectShopId() == null ? other.getCollectShopId() == null : this.getCollectShopId().equals(other.getCollectShopId()))
            && (this.getInputTime() == null ? other.getInputTime() == null : this.getInputTime().equals(other.getInputTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getCollectId() == null) ? 0 : getCollectId().hashCode());
        result = prime * result + ((getCollectUserId() == null) ? 0 : getCollectUserId().hashCode());
        result = prime * result + ((getCollectShopId() == null) ? 0 : getCollectShopId().hashCode());
        result = prime * result + ((getInputTime() == null) ? 0 : getInputTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", collectId=").append(collectId);
        sb.append(", collectUserId=").append(collectUserId);
        sb.append(", collectShopId=").append(collectShopId);
        sb.append(", inputTime=").append(inputTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}